home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / python.postinst < prev    next >
Text File  |  2008-06-23  |  1KB  |  53 lines

  1. #! /bin/sh -e
  2.  
  3. new_config_file()
  4. {
  5.     cat > /etc/python/debian_config <<-EOF
  6.     [DEFAULT]
  7.     # how to byte-compile (comma separated: standard, optimize)
  8.     byte-compile = standard
  9.     EOF
  10. }
  11.  
  12. case "$1" in
  13.     configure)
  14.     [ -d /etc/python ] || mkdir /etc/python
  15.     [ -f /etc/python/debian_config ] || new_config_file
  16.  
  17.         if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4; then
  18.         oldv=$(echo $2 | sed 's/^\(...\).*/\1/')
  19.         if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  20.         echo "running python rtupdate hooks for python2.5..."
  21.         fi
  22.         for hook in /usr/share/python/runtime.d/*.rtupdate; do
  23.         [ -x $hook ] || continue
  24.         if ! $hook rtupdate python$oldv python2.5; then
  25.             hb=$(basename $hook .rtupdate)
  26.             echo >&2 "error running python rtupdate hook $hb"
  27.             errors=yes
  28.         fi
  29.         done
  30.         [ -z "$errors" ] || exit 4
  31.  
  32.         if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  33.         echo "running python post-rtupdate hooks for python2.5..."
  34.         fi
  35.         for hook in /usr/share/python/runtime.d/*.rtupdate; do
  36.         [ -x $hook ] || continue
  37.         if ! $hook post-rtupdate python$oldv python2.5; then
  38.             hb=$(basename $hook .rtupdate)
  39.             echo >&2 "error running python post-rtupdate hook $hb"
  40.             errors=yes
  41.         fi
  42.         done
  43.         [ -z "$errors" ] || exit 5
  44.         fi
  45. esac
  46.  
  47. # Automatically added by dh_installdocs
  48. if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
  49.     install-docs -i /usr/share/doc-base/python-policy
  50. fi
  51. # End automatically added section
  52.  
  53.